package com.study.spring.aop;

import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Created by 汪贵春 on 2017/2/22.
 */
public class TestAop {

    public static void main(String[] args) {

        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        Calculator calculator = context.getBean("calculator",Calculator.class);
        System.out.println(calculator.add(1,2));
        System.out.println(calculator.sub(10,2));


        ((ConfigurableApplicationContext)context).close();

    }

}
